package com.cnu.sys.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cnu.sys.entity.Irregular;
import com.cnu.sys.mapper.IrregularMapper;
import com.cnu.sys.service.IIrregularService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lmq
 * @since 2023-09-06
 */
@Service
public class IrregularServiceImpl extends ServiceImpl<IrregularMapper, Irregular> implements IIrregularService {

    @Override
    public List<Map<String, Object>> getList() {
        List<Irregular> list = this.list();
        List<Map<String, Object>> rows = new ArrayList<>();

        for(Irregular irregular: list) {
            Map<String, Object> map = new HashMap<>();
            map.put("id", irregular.getId());
            map.put("longitude", irregular.getLongitude());
            map.put("latitude", irregular.getLatitude());
            rows.add(map);
        }
        return rows;
    }
}
